<?php
//var_dump($_SERVER);
$save = "e:\\test.epub";
$age = 'Stanza/1.7 iPhone OS/2.2.1/iPod touch catalog/1.7';
//$url = "http://218.85.74.53/stanza_authorize.asp?FileName=JiaoCaiZiLiao/XinLiXueYuShengHuo.epub&cost=0&istemp=True";
$url = "http://218.85.74.53/ebooks/bookfiles/YouXiJingJi/files_ljlkqerlerkq3454oil/ShuShan.epub";
$cookie = "wR5_auth=b0b2OytsnyPXlUJmmF2ooKrytH9pjflmPx3pr8PbIWKtpAxN4%2Ff%2FRykDWx64dwrv%2FqoJhb4J7e7QkIoiTrEAdB14; uid=617; password=7895123; username=netxlong; ASPSESSIONIDQSCABDDQ=ABAIEPKCLOAFHCIKLFAMMDAH
Authorization: Basic bmV0eGxvbmc6Nzg5NTEyMw==";

require_once("HTTP/Request.php");
$req = new HTTP_Request($url);
$req->setMethod(HTTP_REQUEST_METHOD_GET);
$req->addHeader("USER-AGENT", $age);
$req->addHeader("Cookie", $cookie);
if (!PEAR::isError($req->sendRequest())) {
		 $response = $req->getResponseBody();
} else {
		 $response = '';
		 die('fail fetch list');
}
file_put_contents($save, $response);